using System;
using System.Collections;

namespace THANHTUNGO.Portal.Components.Settings
{
    public class Tab : IComparable
    {
        private int _ID;
        private string _Name;
        private int _Order;
        private string _AuthorizedRoles;
        private string _ThemeName;
        private bool _ShowLeftPane;
        private bool _ShowRightPane;
        private bool _ShowOnMenu;

        private ArrayList _Modules = new ArrayList();
        private int _Index;

        public int ID
        {
            get { return this._ID; }
            set { this._ID = value; }
        }

        public string Name
        {
            get { return this._Name; }
            set { this._Name = value; }
        }

        public int Order
        {
            get { return this._Order; }
            set { this._Order = value; }
        }

        public string AuthorizedRoles
        {
            get { return this._AuthorizedRoles; }
            set { this._AuthorizedRoles = value; }
        }

        public string ThemeName
        {
            get { return this._ThemeName; }
            set { this._ThemeName = value; }
        }

        public bool ShowLeftPane
        {
            get { return _ShowLeftPane; }
            set { _ShowLeftPane = value; }
        }

        public bool ShowRightPane
        {
            get { return _ShowRightPane; }
            set { _ShowRightPane = value; }
        }

        public ArrayList Modules
        {
            get { return this._Modules; }
            set { this._Modules = value; }
        }

        public int Index
        {
            get { return this._Index; }
            set { this._Index = value; }
        }

        public bool ShowOnMenu
        {
            get { return this._ShowOnMenu; }
            set { this._ShowOnMenu = value; }
        }

        #region IComparable Members

        public int CompareTo(object value)
        {
            if (value == null) return 1;

            int compareOrder = ((Tab)value).Order;

            if (this.Order == compareOrder) return 0;
            if (this.Order < compareOrder) return -1;
            if (this.Order > compareOrder) return 1;
            return 0;
        }

        #endregion
    }
}